package cn.echoedu.command;

import cn.echoedu.command.base.ExecuteParam;
import cn.echoedu.command.base.FailureParam;
import cn.echoedu.command.base.SuccessParam;
import cn.echoedu.entity.SchoolCalendar;

import com.google.gson.Gson;

public class SchoolCalendarCommand extends BaseCommand{

	public void executeSuccess(SuccessParam successparam) {
		SchoolCalendar schoolcalendar = (SchoolCalendar)successparam.getParam();
		SchoolCalendarSuccess schoolcalendarsuccess = new SchoolCalendarSuccess();
		if(schoolcalendar!=null){
			schoolcalendarsuccess.setCode(successparam.getCode());
			schoolcalendarsuccess.setMsg("School Calendar Success");
			schoolcalendarsuccess.setTitle(schoolcalendar.getTitle());
			schoolcalendarsuccess.setContent(schoolcalendar.getContent());
			schoolcalendarsuccess.setYear(schoolcalendar.getYear());
            String result = new Gson().toJson(schoolcalendarsuccess);
			send(result,successparam.getResponse());
		}
	}

	public void executeFailure(FailureParam failureparam) {

	}

	public void execute(ExecuteParam executeparam) {

	}
	class SchoolCalendarSuccess{
		private int code;
		private String msg;
		private String title;
		private String content;
		private String year;

		public   int getCode() {
			return code;
		}
		public   void setCode(int code) {
			this.code = code;
		}
		public   String getMsg() {
			return msg;
		}
		public   void setMsg(String msg) {
			this.msg = msg;
		}
		public   String getTitle() {
			return title;
		}
		public   void setTitle(String title) {
			this.title = title;
		}
		public   String getContent() {
			return content;
		}
		public   void setContent(String content) {
			this.content = content;
		}
		public   String getYear() {
			return year;
		}
		public   void setYear(String year) {
			this.year = year;
		}

	}


}
